home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / app / BaseUndoManager$UndoAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  1.2 KB  |  35 lines

  1. package com.extensibility.app;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5.  
  6. public class BaseUndoManager$UndoAction extends BaseAction {
  7.    // $FF: synthetic field
  8.    final BaseUndoManager this$0;
  9.  
  10.    public BaseUndoManager$UndoAction(BaseUndoManager var1, String var2, int var3) {
  11.       super(var2, var3);
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void actionOccurred(ActionEvent var1) {
  16.       if (this.this$0.canUndo()) {
  17.          this.this$0.undo();
  18.       }
  19.  
  20.       this.updateUndoState();
  21.       this.this$0.redoAction.updateRedoState();
  22.    }
  23.  
  24.    protected void updateUndoState() {
  25.       if (this.this$0.canUndo()) {
  26.          ((AbstractAction)this).setEnabled(true);
  27.          ((AbstractAction)this).putValue("Name", this.this$0.getUndoPresentationName());
  28.       } else {
  29.          ((AbstractAction)this).setEnabled(false);
  30.          ((AbstractAction)this).putValue("Name", "Undo");
  31.       }
  32.  
  33.    }
  34. }
  35.